API Documentation
Public Member Functions | List of all members
nkGraphics::SamplerManager Class Referencefinal

Manages the samplers available in the component. More...

Inheritance diagram for nkGraphics::SamplerManager:

Public Member Functions

 ~SamplerManager ()
 
SamplercreateOrRetrieve (const nkMemory::StringView &name)
 
Samplerget (const nkMemory::StringView &name)
 
SamplergetByIndex (unsigned int id)
 
void rename (const nkMemory::StringView &oldName, const nkMemory::StringView &newName)
 
void erase (const nkMemory::StringView &name)
 

Detailed Description

Manages the samplers available in the component.

The manager owns all memory returned. External code should never delete it.

Constructor & Destructor Documentation

◆ ~SamplerManager()

nkGraphics::SamplerManager::~SamplerManager ( )

Destructor.

Member Function Documentation

◆ createOrRetrieve()

Sampler* nkGraphics::SamplerManager::createOrRetrieve ( const nkMemory::StringView name)

Creates if unavailable, or retrieves if available, a sampler.

Parameters
nameThe name of the sampler to use.
Returns
The sampler requested, possibly freshly created. The manager owns the memory, external code should never delete it. See erase().

◆ get()

Sampler* nkGraphics::SamplerManager::get ( const nkMemory::StringView name)

Retrieves an existing sampler.

Parameters
nameThe name of the sampler to retrieve.
Returns
The sampler requested if available, nullptr else.

◆ getByIndex()

Sampler* nkGraphics::SamplerManager::getByIndex ( unsigned int  id)

Retrieves a sampler by index. Note that an index can return a different sampler if the internal memory is modified. Mainly used for looping over all available samplers in one go.

Parameters
idThe index to use.
Returns
The linked sampler if available, nullptr else.

◆ rename()

void nkGraphics::SamplerManager::rename ( const nkMemory::StringView oldName,
const nkMemory::StringView newName 
)

Renames a sampler, changing both its name and way of addressing it in the manager.

Parameters
oldNameThe name of the sampler to move.
newNameThe new name to assign to the sampler.

◆ erase()

void nkGraphics::SamplerManager::erase ( const nkMemory::StringView name)

Erases a sampler and frees its memory.

Parameters
nameThe name of the sampler to erase.

The documentation for this class was generated from the following file: